package com.example.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ShowActivity extends AppCompatActivity {

    private TextView Username;
    private TextView Password;
    private Button B1;
    private Button B2;
    private Button B3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show);
        Intent intent = getIntent();
        String usename = intent.getStringExtra("username");
        String password = intent.getStringExtra("password");
        Username = (TextView)findViewById(R.id.this_username);
        Password = (TextView)findViewById(R.id.this_password);
        Username.setText("用户名:" + usename);
        Password.setText("密 码：" + password);

        B1 = (Button)findViewById(R.id.button2);
        B2 = (Button)findViewById(R.id.button3);
        B3 = (Button)findViewById(R.id.button4);
        B1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setData(Uri.parse("https://www.baidu.com/"));
                startActivity(intent);
            }
        });

        B2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = getPackageManager().getLaunchIntentForPackage("tv.danmaku.bili");
                startActivity(intent);
            }
        });

        B3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = getPackageManager().getLaunchIntentForPackage("com.tencent.mtt");
                startActivity(intent);
            }
        });
    }
}
